var staffId = "";
$(function(){
	staffId = $("#staffIdByRoles").val();
});

function onQueryRoleInfoListSucc(){
	findStaffRolesAjax.addParam("staffId",staffId);
	findStaffRolesAjax.send();
}

var oldRoles = null;
function onFindStaffRoleSucc(data){
	if(data.success == true){
		oldRoles = data.info;
		var html = "";
		$.each(oldRoles,function(index,item){
			if(item != null){
				html += '<p class="itemDiv" name="'+item.roleId+'">'+
						'<input style="display:none" value="'+item.roleId+'">'+
						'<span class="roleshow label label-warning">'+item.roleName+
							'<a href="javascript:;" title="删除" onclick="removeRole(\''+item.roleId+'\')">'+
							'<i class="icon icon-times"></i></a></span>'+
					'</p>';
			}
		});
		$(".rolesShowDiv").empty();
		$(".rolesShowDiv").append(html);
	}
}

function closeDia(){
	MsgBox.closeActiveDialog();
}